package com.zte.claa.inficombo.csa.app.service.sapi.ffhost;

import org.apache.mina.core.future.WriteFuture;

import com.zte.claa.inficombo.csa.app.service.sapi.ffhost.mina.FFTransDevMessage;

public interface FFTransDevSAPIService {
	
	/**
	 * 接收底层消息上报
	 * 
	 * @param sessionId
	 * @param message
	 */
	public void onFFTransDevMessageReport(long sessionId, FFTransDevMessage message);
	
	/**
	 * 底层链路关闭通知.
	 * 
	 * @param sessionId
	 */
	public void onConnectionClose(long sessionId);
	
	/**
	 * 底层链路异常上报.
	 * 
	 * @param sessionId
	 * @param cause
	 */
	public void onExceptionReport(long sessionId, Throwable cause);
	
	/**
	 * 上层应用主动关闭某个传输装置的链路
	 * 
	 * @param transDevEui
	 * @throws Exception
	 */
	public void closeConnection(String transDevEui) throws Exception;
	
	/**
	 * 上层应用主动下发命令
	 * 
	 * @param transDevEui
	 * @throws Exception
	 */
	public WriteFuture sendCommand(String transDevEui, FFTransDevCommand cmd) throws Exception;
}
